import request from '../request';

/**
 * 获取员工列表
 * @returns {Promise}
 */
export const getStaff = () => {
  return request({
    url: '/staff',
    method: 'get'
  });
};

/**
 * 添加员工
 * @param {Object} data - 员工信息
 * @returns {Promise}
 */
export const addStaff = (data) => {
  return request({
    url: '/staff',
    method: 'post',
    data
  });
};

/**
 * 更新员工信息
 * @param {string} id - 员工ID
 * @param {Object} data - 员工信息
 * @returns {Promise}
 */
export const updateStaff = (id, data) => {
  return request({
    url: `/staff/${id}`,
    method: 'put',
    data
  });
};

/**
 * 删除员工
 * @param {string} id - 员工ID
 * @returns {Promise}
 */
export const deleteStaff = (id) => {
  return request({
    url: `/staff/${id}`,
    method: 'delete'
  });
};